#ifndef NETWORK_ZINGME_NETWORKZINGMEGETONLINEFRIENDRESPONSE_H
#define NETWORK_ZINGME_NETWORKZINGMEGETONLINEFRIENDRESPONSE_H

#include "network/networkjsonlistresponse.h"

#include <QObject>
#include <QMap>


class GetOnlineFriendResponse : public Network::JSONResponse
{
    Q_OBJECT
public:
    class Item
    {
    public:
        Item(qint64 id, qint64 mobileTime, qint64 webTime);

    private:
        qint64 m_id;
        qint64 m_mobileTime;
        qint64 m_webTime;

    public:
        inline void setId(qint64 id) {
            m_id = id;
        }

        inline qint64 id() const {
            return m_id;
        }

        inline void setMobileTime(qint64 time) {
            m_mobileTime = time;
        }

        inline qint64 mobileTime() const {
            return m_mobileTime;
        }

        inline void setWebTime(qint64 time) {
            m_webTime = time;
        }

        inline qint64 webTime() const {
            return m_webTime;
        }
    };

public:
    typedef QList<Item*> ItemList;

public:
    explicit GetOnlineFriendResponse(QObject *parent = 0);
    virtual ~GetOnlineFriendResponse();
    void clearData();

private:
    ItemList m_items;

private:
    void parse(const QVariant &data);
    void parseList(const QVariantList &list);

public:
    inline const ItemList &items() const {
        return m_items;
    }
};


#endif // NETWORK_ZINGME_NETWORKZINGMEGETONLINEFRIENDRESPONSE_H
